programming4us
           
 
 
Windows

Windows 7 : Working with Users and Groups from the Command Line

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
12/24/2010 9:09:55 AM
You can script your user and group chores by taking advantage of the NET USER and NET LOCALGROUP commands. These commands enable you to add users, change passwords, modify accounts, add users to groups, and remove users from groups. Note that you must run these commands under the Administrator account, so first follow these steps to open a command prompt session:

1.
Select Start, All Programs, Accessories.

2.
Right-click Command Prompt, and then click Run As Administrator.

3.
Enter your User Account Control credentials.

The NET USER Command

You use the NET USER command to add users, set account passwords, disable accounts, set account options (such as the times of day the user is allowed to log on), and remove accounts. For local users, the NET USER command has the following syntax:

NET USER [username [password | * | /RANDOM] [/ADD] [/DELETE] [options]]

usernameThe name of the user you want to add or work with. If you run NET USER with only the name of an existing user, the command displays the user’s account data.
passwordThe password you want to assign to the user. If you use *, Windows 7 prompts you for the password; if you use the /RANDOM switch, Windows 7 assigns a random password (containing eight characters, consisting of a random mix of letters, numbers, and symbols), and then displays the password on the console.
/ADDCreates a new user account.
/DELETEDeletes the specified user account.
optionsThese are optional switches you can append to the command:
 /ACTIVE:{YES | NO} Specifies whether the account is active or disabled.
 /EXPIRES:{date | NEVER} The date (expressed in the system’s Short Date format) on which the account expires.
 /HOMEDIR:path The home folder for the user, which should be a subfolder within %SystemDrive%\Users (make sure that the folder exists).
 /PASSWORDCHG:{YES | NO} Specifies whether the user is allowed to change his password.
 /PASSWORDREQ:{YES | NO} Specifies whether the user is required to have a password.
/PROFILEPATH:pathThe folder that contains the user’s profile.
/SCRIPTPATH:pathThe folder that contains the user’s logon script.
/TIMES:{times | ALL}Specifies the times that the user is allowed to log on to the system. Use single days or day ranges (for example, Sa or M-F). For times, use 24-hour notation or 12-hour notation with am or pm. Separate the day and time with a comma, and separate day/time combinations with semicolons. Here are some examples:
M-F,9am-5pm
M,W,F,08:00-13:00
Sa,12pm-6pm;Su,1pm-5pm


Caution

If you use the /RANDOM switch to create a random password, make a note of the new password so that you can communicate it to the new user.


Note, too, that if you execute NET USER without any parameters, it displays a list of the local user accounts.

Tip

If you want to force a user to log off when his logon hours expire, open the Group Policy Editor and select Computer Configuration, Windows Settings, Security Settings, Local Policies, Security Options. In the Network Security category, enable the Force Logoff When Logon Hours Expire policy.


The NET LOCALGROUP Command

You use the NET LOCALGROUP command to add users to and remove users from a specified security group. NET LOCALGROUP has the following syntax:

NET LOCALGROUP [group name1 [name2 ...] {/ADD | /DELETE}

groupThis is the name of the security group with which you want to work.
name1 [name2 ...]One or more usernames that you want to add or delete, separated by spaces.
/ADDAdds the user or users to the group.
/DELETERemoves the user or users from the group.
Other -----------------
- Windows 7 : Setting Account Policies (part 2)
- Windows 7 : Setting Account Policies (part 1)
- Windows 7 : Creating and Managing User Accounts (part 2) - Working with the User Accounts Dialog Box
- Windows 7 : Creating and Managing User Accounts (part 1)
- Windows Vista : Managing Local Logon Accounts
- Windows Vista : User Accounts and Groups
- SOA with .NET and Windows Azure : Windows Workflow Foundation (part 7)
- SOA with .NET and Windows Azure : Windows Workflow Foundation (part 6)
- SOA with .NET and Windows Azure : Windows Workflow Foundation (part 5) - WF Programming Model
- SOA with .NET and Windows Azure : Windows Workflow Foundation (part 4) - Activities
- SOA with .NET and Windows Azure : Windows Workflow Foundation (part 3) - Workflow Persistence
- SOA with .NET and Windows Azure : Windows Workflow Foundation (part 2) - Workflows
- SOA with .NET and Windows Azure : Windows Workflow Foundation (part 1) - WF Architecture
- Windows 7 : Creating and Enforcing Bulletproof Passwords (part 3) - Recovering from a Forgotten Password
- Windows 7 : Creating and Enforcing Bulletproof Passwords (part 2) - Taking Advantage of Windows 7’s Password Policies
- Windows 7 : Creating and Enforcing Bulletproof Passwords (part 1)
- Windows 7 : Understanding User Account Control (part 3) - User Account Control Policies
- Windows 7 : Understanding User Account Control (part 2) - Configuring User Account Control
- Windows 7 : Understanding User Account Control (part 1) - Elevating Privileges
- Windows 7 : Encrypting a Disk with BitLocker (part 2) - Enabling BitLocker on a System Without a TPM
 
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us